
<div id="main" style="margin:0 auto; width: 90%;">
    <p><h4>请选择日期：</h4></p>
    <ul class="nav nav-pills">
         <form action="index" method="post" style="padding-top: 6px;">
             <li style="display:inline;"><label for="channel"> 渠道号：</label><input type="text"  id="channel" name="channel"></li>
            <li style="display:inline;"><label for="start_datepicker"> 开始日期：</label><input type="text"  id="start_datepicker" name="start"></li>
            <li style="display:inline;"><label for="end_datepicker"> 结束日期：</label><input type="text"  id="end_datepicker" name="end"></li>
            <li style="display:inline;"><input type="submit" value="确定"/></li>
        </form>
    </ul>
    <?php
     if ($start && $end):
        echo $start ." ~ ". $end;
       endif;
    ?>
    <div class="panel panel-default" style="margin-top:20px;">
        <div class="panel-body">
            <table class="table table-hover">
                    <thead>
                    <tr>
                        <th width="200px">日期</th>
                        <th width="200px">产品</th>
                        <th width="200px">时长</th>
                        <th width="200px">URL</th>
                    </tr>
                    </thead>
                    <tbody></tbody>
            </table>
        </div>
    </div>
</div>
<script>
    $(function(){ 
        $("#start_datepicker").datepicker({
            dateFormat: "yy-mm-dd",
            maxDate: new Date(),
            onselect:function(dateText,inst){
                $("#end_datepicker").datepicker("option","minDate",dateText);  
            }
        }); 
        $("#end_datepicker").datepicker({
            dateFormat: "yy-mm-dd",
            maxDate: new Date(),
            onselect:function(dateText,inst){
                $("#start_datepicker").datepicker("option","minDate",dateText);  
            }
        });   
    });    
</script>
